<?php

namespace App\Models;

use Zizaco\Entrust\EntrustRole;
use Illuminate\Database\Eloquent\SoftDeletes;

class Role extends EntrustRole {

    use SoftDeletes;

    protected $fillable = [
        'name',
        'display_name',
        'description'
    ];

    protected $dates = ['deleted_at'];

    public function scopeOfAdmins($query)
    {
        return $query->whereIn('name', config('setting.adminGroups'));
    }

    public function scopeOfHr($query)
    {
        return $query->where('name', config('setting.hrGroup'));
    }

    public function scopeOfCompany($query)
    {
        return $query->where('name', config('setting.companyGroup'));
    }

}